package com.my.main.service.userAndRight;

import com.my.main.base.service.BaseService;
import com.my.main.entity.userAndRight.SysRightsRoleUserRelation;
import com.my.main.entity.userAndRight.SysUser;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public interface SysUserService extends BaseService<SysUser> {


    /**
     * 根据mobile查询用户
     */
    public SysUser findByMobile(String phone);

    /**
     * 根据登录名查询用户
     */
    public SysUser findByUserName(String userName);

    /**
     * 通过用户ID查询关联的角色ID
     * @param userId
     * @return
     */
    public List<SysRightsRoleUserRelation> queryUserRole(String userId);

    /**
     * 给用户添加角色
     * @param userId
     * @param roleIdList
     */
    public void isSvaeUserRole(String userId, List<String> roleIdList, String handleUserId, String ip);

    /**
     * 新增用户并添加角色
     * @param sysUser
     * @param sysRightsRoleUserRelation
     */
    public void isSave(SysUser sysUser, SysRightsRoleUserRelation sysRightsRoleUserRelation);

    /**
     * 根据角色id查询用户
     */
    public List<Map<String, Object>> queryUserByRoleId(String roleId);

}
